//
//  LDBaseSingleLineCell.swift
//  DingDongZP
//
//  Created by 三秒文化 on 2016/10/21.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

import UIKit

class LDBaseSingleLineCell: LDBaseCells {
    
    var title:String? {
        didSet{
            
            titleLab?.text = title
        }
    }
    
    private var titleLab:UILabel?
    var statusBtn:UIButton?
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        initUI()
    }
    
    func initUI() {
        
        titleLab = UILabel.setBaseLab("", fontSize: 14, titleColor: LDFontColor.Black, Alignment: .Left)
        statusBtn = UIButton()
        
        statusBtn?.setImage(UIImage(named: "common_line_false"), forState: UIControlState.Normal)
        statusBtn?.setImage(UIImage(named: "common_line_sure"), forState: UIControlState.Selected)
        
        addSubview(titleLab!)
        addSubview(statusBtn!)
        
        titleLab?.snp_makeConstraints(closure: { (make) in
            
            make.left.equalTo(LDMargin_V*3)
            make.centerY.equalTo(self)
            make.height.equalTo(20)
            
        })
        
        statusBtn?.snp_makeConstraints(closure: { (make) in
            
            make.right.equalTo(-LDMargin_V*2)
            make.centerY.equalTo(self)
            make.size.equalTo(CGSizeMake(15, 15))
        })
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
